home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / VerticalSpinButtonPanel.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  2.5 KB  |  89 lines

  1. package symantec.itools.awt;
  2.  
  3.  
  4. /**
  5.  * This component groups the two spin buttons vertically. It is used for 
  6.  * spinners with the ORIENTATION_VERTICAL attribute set.
  7.  * @see Spinner
  8.  * @see Orientation
  9.  *
  10.  * @version 1.0, Nov 26, 1996
  11.  *
  12.  * @author    Symantec
  13.  *
  14.  */
  15.  
  16.  
  17. public class VerticalSpinButtonPanel
  18.     extends SpinButtonPanel
  19. {
  20.     //--------------------------------------------------
  21.     // constants
  22.     //--------------------------------------------------
  23.  
  24.  
  25.     //--------------------------------------------------
  26.     // class variables
  27.     //--------------------------------------------------
  28.  
  29.  
  30.     //--------------------------------------------------
  31.     // member variables
  32.     //--------------------------------------------------
  33.  
  34.  
  35.     //--------------------------------------------------
  36.     // constructors
  37.     //--------------------------------------------------
  38.  
  39.     /**
  40.      * Constructs the default VerticalSpinButtonPanel.
  41.      */
  42.     public VerticalSpinButtonPanel()
  43.     {
  44.         resize(16, 22);
  45.     }
  46.  
  47.  
  48.     //--------------------------------------------------
  49.     // accessor members
  50.     //--------------------------------------------------
  51.  
  52.  
  53.     //--------------------------------------------------
  54.     // event methods
  55.     //--------------------------------------------------
  56.  
  57.  
  58.     //--------------------------------------------------
  59.     // class methods
  60.     //--------------------------------------------------
  61.  
  62.  
  63.     //--------------------------------------------------
  64.     // member methods
  65.     //--------------------------------------------------
  66.  
  67.     /**
  68.      * Moves and/or resizes this component.
  69.      * This is a standard Java AWT method which gets called to move and/or
  70.      * resize this component. Components that are in containers with layout
  71.      * managers should not call this method, but rely on the layout manager
  72.      * instead.
  73.      *
  74.      * This method is overridden to reshape the two direction buttons so they
  75.      * both fit within the panel's new shape.
  76.      *
  77.      * @param x horizontal position in the parent's coordinate space
  78.      * @param y vertical position in the parent's coordinate space
  79.      * @param width the new width
  80.      * @param height the new height
  81.      */
  82.     public void reshape(int x, int y, int width, int height)
  83.     {
  84.         incButton.reshape(0, 0, width, height / 2);
  85.         decButton.reshape(0, height / 2 - 1, width, height / 2);
  86.  
  87.         super.reshape(x, y, width, height);
  88.     }
  89. }